from playwright.async_api import BrowserContext, Page


# 登录推特
async def login_x(browser: BrowserContext) -> Page:
    print('开始登录 x')
    page = await browser.new_page()
    await page.goto("https://x.com")
    await page.wait_for_timeout(2000)
    # 页面交互
    # 等待 5s
    # await page.wait_for_timeout(5000)
    print('x 登录成功')
    return page
